<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>系统</title>
  <!-- Tell the browser to be responsive to screen width -->
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <link rel="stylesheet" type="text/css" href="${request.contextPath}/statics/plugins/layui/css/layui.css">
    <link rel="stylesheet" type="text/css" href="${request.contextPath}/statics/js/login/css/normalize.css" />
    <link rel="stylesheet" type="text/css" href="${request.contextPath}/statics/js/login/css/default.css">
    <script src='${request.contextPath}/statics/js/login/js/prefixfree.min.js'></script>
    <link rel="stylesheet" type="text/css" href="${request.contextPath}/statics/js/login/css/styles.css">
</head>
<body>
<div id="logo">
    <h1 class="hogo"><i> STARK INDUSTRIES</i></h1>
</div>
<section class="stark-login">
    <form  class="layui-form" action="">
        <div id="fade-box">
            <input type="text" name="username" id="username" placeholder="Username" required  class="layui-input">
            <input type="password" name="password" placeholder="Password" required  class="layui-input">
            <a alt="如果看不清楚，请单击图片刷新！" class="src"/>
            <a class="layui-btn" lay-submit="" lay-filter="login">Log In</a>
        </div>
    </form>
    <div class="hexagons">
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <br>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <br>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>

        <br>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <br>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
        <span>&#x2B22;</span>
    </div>
</section>

<div id="circle1">
    <div id="inner-cirlce1">
        <h2> </h2>
    </div>
</div>
<ul>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
    <li></li>
</ul>
<header class="htmleaf-header">
    <h1>系统登录入口 <span>A User login interface  </span></h1>
    <div class="htmleaf-links">
    </div>
</header>

<!-- /.login-box -->
<script type="text/javascript" src="${request.contextPath}/statics/layui/layui.js"></script>
<script>
    var baseURL = "../../";
    layui.use(['form', 'layedit', 'laydate','jquery'], function(){
        var form = layui.form;
        var   $ = layui.jquery;
        //请求验证码
        // var url = "captcha.jpg?t=" + $.now();//  "这里是在地址栏可以查看的图片链接"
        // var xhr = new XMLHttpRequest();
        // xhr.open('GET', url, true);
        // xhr.responseType = "blob";
        // xhr.onload = function () {
        //     var blob = this.response;
        //     var img = document.createElement("img");
        //     img.onload = function (e) {
        //         window.URL.revokeObjectURL(img.src);
        //     };
        //     img.src = window.URL.createObjectURL(blob);
        //     console.log(img)
        //     $(".src").html(img);
        // }
        // xhr.send();

        form.on('submit(login)', function(data){
            // var data = "username="+data.username+"&password="+data.password;
            data =data.field;
            $.ajax({
                url:"SysLogin",
                data: data,
                dataType: "json",
                type: "post",
                async: false,
                success: function(result){
                    if(result.code == 0){//登录成功
                        parent.location.href ='index.html';
                    }else{
                        layer.msg(result.msg)
                    }
                }
            });
        });
    });
</script>
</body>
</html>
